package com.group9.handinhand.social;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.encrypt.TextEncryptor;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionFactoryLocator;
import org.springframework.social.connect.ConnectionKey;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.util.MultiValueMap;

import com.group9.handinhand.service.SocialUserService;

public class ConnectionRepositoryImpl implements ConnectionRepository{
	
	@Autowired
	SocialUserService socialUserService;
	
	private final String userId;
	
	private final ConnectionFactoryLocator connectionFactoryLocator;

	private final TextEncryptor textEncryptor;

	public ConnectionRepositoryImpl(String userId, ConnectionFactoryLocator connectionFactoryLocator, TextEncryptor textEncryptor, SocialUserService socialUserService) {
		this.userId = userId;
		this.connectionFactoryLocator = connectionFactoryLocator;
		this.textEncryptor = textEncryptor;
		this.socialUserService = socialUserService;
	}

	public String getUserId() {
		return userId;
	}

	@Override
	public MultiValueMap<String, Connection<?>> findAllConnections() {
		return null;
	}

	@Override
	public List<Connection<?>> findConnections(String providerId) {
		return null;
	}

	@Override
	public <A> List<Connection<A>> findConnections(Class<A> apiType) {
		return null;
	}

	@Override
	public MultiValueMap<String, Connection<?>> findConnectionsToUsers(
			MultiValueMap<String, String> providerUserIds) {
		return null;
	}

	@Override
	public Connection<?> getConnection(ConnectionKey connectionKey) {
		return null;
	}

	@Override
	public <A> Connection<A> getConnection(Class<A> apiType, String providerUserId) {
		return null;
	}

	@Override
	public <A> Connection<A> getPrimaryConnection(Class<A> apiType) {
		return null;
	}

	@Override
	public <A> Connection<A> findPrimaryConnection(Class<A> apiType) {
		return null;
	}

	@Override
	public void removeConnections(String providerId) {
		
	}

	@Override
	public void removeConnection(ConnectionKey connectionKey) {
	}

	@Override
	public void addConnection(Connection<?> connection) {
		socialUserService.addConnection(userId, connection);
	}

	@Override
	public void updateConnection(Connection<?> connection) {
		socialUserService.updateConnection(userId, connection);
	}

}
